package com.stylefeng.guns.modular.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.stylefeng.guns.core.support.RegKit;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 * 联系人
 * </p>
 *
 * @author yinjc123
 * @since 2018-04-02
 */
@TableName("crm_contact")
@Data
public class Contact extends Model<Contact> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    private String name;
    /**
     * 部门名称
     */
    @TableField("depart_name")
    private  String departName;
    /**
     * 企业id
     */
    @TableField("customer_company_id")
    @NotNull(message = "企业ID不能为空")
    private Integer customerCompanyId;
    /**
     * 岗位职务
     */
    @NotBlank(message = "岗位职务不能为空")
    private String post;
    /**
     * 手机号
     */
    @TableField("mobile_num")
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = RegKit.CHINA_PHONE,message = "手机号格式不正确")
    private String mobileNum;
    /**
     * 备用手机号
     */
    @TableField("standby_mobile_num")
    private String standbyMobileNum;
    /**
     * 办公电话
     */
    private String landline;
    /**
     * 传真
     */
    private String facsimile;

    /**
     * 电子邮箱
     */
    private String email;
    /**
     * 微信号
     */
    private String wechat;


    private Long qq;
    /**
     * 态度
     */
    @TableField("attitude")
    private String attitude;
    /**
     * 备注
     */
    private String remark;

    @TableField(value = "delete_flag")
    //@TableLogic
    private Integer deleteFlag;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
